<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="author" content="wangbo">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>state </title>
</head>

<body>
    <div id="app" ></div>
    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <!-- 专门设置props的库 -->
    <script src="../js/prop-types.js"></script>
    <script src="../js/babel.min.js"></script>
    <script type="text/babel">
        class MyData extends React.Component {
            constructor(props) {
                super(props)
                this.chg =this.chg.bind(this)
            }
            // 这个是window给的,只能是当前的方法调用的对象,不是真正的
            chg(event){
                // 也可以获取到dom的对象
                event.target.innerText='我改变了'
                console.log(event.target)
            }
            render() {
                return  <div onClick={this.chg} >事件源对象 </div>                 
            }
        }
        ReactDOM.render(<MyData />, document.getElementById('app'))
    </script>
</body>

</html>